﻿namespace Spring.PureMVC.Adapters
{
    internal class SendNotificationAdapter
    {
        private object _notification;
        public object Notification
        {
            set
            {
                _notification = value;
                SendNotification();
            }
            private get { return _notification; }
        }

        private object _facade;
        public object Facade
        {
            set
            {
                _facade = value;
                SendNotification();
            }
            private get { return _facade; }
        }

        private void SendNotification()
        {
            if (Notification == null || Facade == null) return;
            Facade.GetType().GetMethod("NotifyObservers", new[] { Notification.GetType() })
.Invoke(Facade, new[] { Notification });
        }
    }
}
